<template>
  <div class="app-footer">
    <div class="flex-row-justify-center">
      <div class="flex-1 fast-entry flex">
        <div class="entry-item"
          :class="!!item.width ? '' : 'flex-1'"
          :style="{
            width: item.width || 'auto'
          }"
          v-for="item in menuList"
          :key="item.id"
          >
          <div class="entry-title">{{ item.title }}
            <div class="split-line"></div>
          </div>
          <div class="entry-info"
            v-for="(info, index) in item.children"
            :key="index"
            @click="toPath(info.path)">{{ info.text }}</div>
        </div>
      </div>
      <div class="other-plat flex">
        <div class="plat-item">
          <img src="https://www.naodong3d.com/prod-api/files/9c4af26b-74b1-425d-8210-0319d170b743.jpg" />
          <div>微信公众号</div>
        </div>
        <div class="plat-item">
          <img src="https://www.naodong3d.com/prod-api/files/6765fdf1-be34-4e31-8063-22f7b15c9ae2.png" />
          <div>脑洞客服</div>
        </div>
      </div>
    </div>
    <div class="copyright">© 2024 脑洞在线3D打印 | 皖ICP备2021003586号</div>
  </div>
</template>

<script setup lang="ts">
import footMenus from "~/config/footMenus"
const menuList = ref(footMenus)
const router = useRouter()

function toPath(path?: string) {
  if (path) {
    router.push(path)
  }
}
</script>

<style lang="scss" scoped>
.app-footer {
  width: 100%;
  padding-top: 35px;
  background-color: #25313f;
  .fast-entry {
    padding-left: 120px;
    .entry-item {
      .entry-title {
        font-size: 18px;
        color: #fff;
        padding-bottom: 15px;
        .split-line {
          width: 14px;
          height: 2px;
          background: $primary;
          margin-top: 15px;
        }
      }
      .entry-info {
        padding-bottom: 20px;
        line-height: 22px;
        font-size: 14px;
        color: #999;
        cursor: pointer;
      }
    }
  }
  .other-plat {
    padding: 0 20px;
    .plat-item {
      width: 160px;
      text-align: center;
      font-size: 18px;
      font-family: Microsoft YaHei-Regular, Microsoft YaHei;
      color: #fff;
      line-height: 40px;
      img {
        display: block;
        width: auto;
        height: 124px;
        margin: 0 auto;
      }
    }
  }
  .copyright {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 20px 0;
  }
}
</style>